
const fs = require('fs');
const path = require('path')

// 点击垃圾箱,删除对应的信息
var delList = document.querySelectorAll('.img2')
for(var i = 0; i < delList.length; i++){
    var del = delList[i];
    del.setAttribute('index',i)
    del.onclick = function(){
        this.parentNode.parentNode.removeChild(this.parentNode);
        fs.readFile(path.join(__dirname,'../../db.json'),(err,data) =>{
            var jsonobj = JSON.parse(data)
            console.log(jsonobj);
            
        })
    }
}
